﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace Web
{
    public static class SetLog
    {  
        /// <summary>
        /// 写入操作日志
        /// </summary>
        /// <param name="logType">日子类型</param>
        /// <param name="adminID">操作人ID</param>
        /// <param name="operIP">操作IP</param>
        /// <param name="result">操作结果：成功Y，失败N</param>
        /// <param name="ext">操作详细</param>
        /// <param return>返回结果，0表示失败，其他>0的数表示成功</param>
        public static int SetAdminLog(string logType,int adminID,string operIP,string result,string ext)
        {
            var res = 0;
            fanli.DAL.fanli_adminlog bll = new fanli.DAL.fanli_adminlog();
            fanli.Model.fanli_adminlog model = new fanli.Model.fanli_adminlog();
            model.adminid = adminID;
            model.ext = ext;
            model.logtype = logType;
            model.operateIP = operIP;
            model.operateResult = result;
            model.operateTime = DateTime.Now;

            res = bll.Add(model);
            return res;
        }
    }
}